#ifndef _PDF2BIN_H_
#define _PDF2BIN_H_

#include "./fxcore/include/fxcrt/fx_system.h"
#include "./fxcore/include/fxcrt/fx_basic.h"
#include "./fxcore/include/fxcrt/fx_stream.h"
#include "./fxcore/include/fxcrt/fx_string.h"
#include "./fxcore/include/fxcrt/fx_fix.h"
#include "./fxcore/include/fxcrt/fx_memory.h"
#include "./fxcore/include/fxcrt/fx_xml.h"
#include "./fxcore/include/fxcrt/fx_coordinates.h"
#include "./fxcore/include/fxcrt/fx_ext.h"

#include "./fxcore/include/fpdfapi/fpdf_module.h"
#include "./fxcore/include/fpdfapi/fpdf_render.h"
#include "./fxcore/include/fpdfapi/fpdf_pageobj.h"
#include "./fxcore/include/fpdftext/fpdf_text.h"
#include "./fxcore/include/fxge/fx_ge_win32.h"
#include "./fxcore/include/fxcodec/fx_codec.h"
#include "./fxcore/include/fxge/fx_ge.h"
#include "./fxcore/include/fpdfapi/fpdf_serial.h"
#include "./fxcore/include/fpdfdoc/fpdf_doc.h"
#include "./fxcore/include/fpdfdoc/fpdf_vt.h"


#include "./fxcore/include/fxfontmgr/fxfm_font.h"


//---------------new version of tagged pdf related interface------------------
#if 0
#include "./fxcore/include/fpdflr/fx_taggedhandler.h"
#include "./fxcore/include/fpdflr/fpdf_lr.h"
#include "./fxcore/include/fpdflr/fpdflr_process.h"
#include "./fxcore/include/fpdflr/fpdflr_factory.h"
#endif
//----------------------------------------------------------------------------

#ifdef _WIN32
#ifdef _DEBUG
//for VC 2010 library
#ifdef _WIN64
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fpdfapi[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fpdfdoc[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fxcodec[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fxcrt[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fxge[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fpdftext[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fdrm[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fxmath[dbg_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x64_vc10/fxfontmgr[dbg_x64_vc10].lib")
#else
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fpdfapi[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fpdfdoc[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fxcodec[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fxcrt[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fxge[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fpdftext[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fdrm[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fxmath[dbg_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fxfontmgr[dbg_x86_vc10].lib")
//#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/LayoutRecognition[dbg_x86_vc10].lib")
//---------------new version of tagged pdf related interface------------------
//#pragma comment(lib, "./fxcore/lib/dbg/x86_vc10/fpdflr[dbg_x86_vc10].lib")
//----------------------------------------------------------------------------
#endif//_win64

#else

#ifdef _WIN64
#pragma comment(lib, "./fxcore/Lib/rel/x64_vc10/fpdfapi[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x64_vc10/fpdfdoc[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x64_vc10/fxcodec[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x64_vc10/fxcrt[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x64_vc10/fxge[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x64_vc10/fpdftext[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/rel/x64_vc10/fdrm[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/rel/x64_vc10/fxmath[rel_x64_vc10].lib")
#pragma comment(lib, "./fxcore/lib/rel/x64_vc10/fxfontmgr[rel_x64_vc10].lib")
#else
// for VC 2010 library
#pragma comment(lib, "./fxcore/Lib/rel/x86_vc10/fpdfapi[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x86_vc10/fpdfdoc[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x86_vc10/fxcodec[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x86_vc10/fxcrt[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x86_vc10/fxge[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/Lib/rel/x86_vc10/fpdftext[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/rel/x86_vc10/fdrm[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/rel/x86_vc10/fxmath[rel_x86_vc10].lib")
#pragma comment(lib, "./fxcore/lib/rel/x86_vc10/fxfontmgr[rel_x86_vc10].lib")
//#pragma comment(lib, "./fxcore/lib/rel/x86_vc10/LayoutRecognition[rel_x86_vc10].lib")
//---------------new version of tagged pdf related interface------------------
//#pragma comment(lib, "./fxcore/lib/rel/x86_vc10/fpdflr[rel_x86_vc10].lib")
//----------------------------------------------------------------------------
#endif //_win64
#endif //_DEBUG
#endif

#define VER_BIN_DOCDATA  0x00010000
void gWriteFXRect2BinaryBuf(CFX_BinaryBuf& buf, FX_RECT& rc);
void gWriteFloatRect2BinaryBuf(CFX_BinaryBuf& buf, CFX_FloatRect& rc);
void gWriteMatrix2BinaryBuf(CFX_BinaryBuf& buf, CPDF_Matrix& mt);
void gWriteArr2BinBuf(CFX_BinaryBuf& buf, CPDF_Array* pArr);

FX_BOOL gSaveFile(FX_LPCBYTE pData,FX_DWORD nLength, FX_LPCSTR filename);

void gWriteLog(CFX_ByteString& file, CFX_ByteString& bsMsg);
#endif
